package com.greenlaw110.cimple.model;

import com.jfinal.plugin.activerecord.Model;
import org.osgl.util.Crypto;

public class Admin extends Model<Admin> {
    public static final Admin dao = new Admin();

    public static boolean authenticate(String username, String password) {
        String hash = Crypto.passwordHash(password);
        return dao.find("select * from admin where username=? and pwd=?", username, hash).size() > 0;
    }
}